import request from '@/utils/request'

// 查询培训列表
export function trainingList(query) {
  return request({
    url: '/study/training/list',
    method: 'get',
    params: query
  })
}

// 发布培训
export function publish(query) {
  return request({
    url: '/study/training/publish',
    method: 'get',
    params: query
  })
}

// 下架培训
export function notPublished(query) {
  return request({
    url: '/study/training/not-published',
    method: 'get',
    params: query
  })
}

// 新增培训
export function addarticle(data) {
  return request({
    url: '/study/training',
    method: 'post',
    data: data
  })
}


// 获取培训详细信息
export function articleId(id) {
  return request({
    url: `/study/training/${id}`,
    method: 'get',
  })
}


// 修改培训
export function eitHarticle(data) {
  return request({
    url: '/study/training',
    method: 'put',
    data: data
  })
}
